package tcpFirmware.model;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class FilmToDB {

    public static boolean upload(String...args){
        String movieName = args[0];
        String marketTime = args[1];
        String detail = args[2];
        String price = args[3];
        String filePath = args[4];
        String filename = args[5];

        DBHelper dbHelper = new DBHelper();
        Connection connection = dbHelper.getConnection();
        try {
            Statement statement = connection.createStatement();
            boolean isCommit = statement.execute("insert into Movie ('"+movieName+"','"+marketTime+"','"+detail+"','"+price+"','"+filePath+"','"+filename+"')");
            return isCommit;
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return false;
    }

}
